/*
 * @lc app=leetcode.cn id=728 lang=cpp
 *
 * [728] 自除数
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <stdlib>
#include <string>
#include <string.h>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>

using namespace std;
// @lc code=start
class Solution {
private:
    vector<int> ret;
public:
    void judge(int n) {
        int m = n;
        bool flag = true;
        while(m) {
            int p = m % 10;
            if(p == 0 || n % p != 0) {
                flag = false;
            }
            m /= 10;
        }
        if(flag) {
            ret.push_back(n);
        }
    }
    vector<int> selfDividingNumbers(int left, int right) {
        for(int i = left;i <= right;i++) {
            judge(i);
        }
        return ret;
    }
};
// @lc code=end

